from django.contrib import admin
from polls.models import Subject
from polls.models import Teacher
from polls.models import User
# Register your models here.

class SubjectAdmin(admin.ModelAdmin):
    list_display = ('no','name','intro','is_hot')
    list_display_links = ('no','name')
    search_fields = ('name',)
    ordering = ('no',)


class TeacherAdmin(admin.ModelAdmin):
    list_display = ('no','name', 'intro')
    list_display_links = ('no', 'name')
    search_fields = ('name',)
    ordering = ('no',)


class UserAdmin(admin.ModelAdmin):
    list_display = ('no', 'username', 'email','tel','last_visit')
    search_fields = ('username',)
    ordering = ('no',)


admin.site.register(Subject, SubjectAdmin)
admin.site.register(Teacher, TeacherAdmin)
admin.site.register(User, UserAdmin)